home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_074 / control / poster < prev   
Text File  |  1992-05-06  |  4KB  |  102 lines

  1. Article 4132 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!oddjob!uwvax!husc6!rutgers!cbmvax!andy
  3. From: andy@cbmvax.cbm.UUCP (Andy Finkel)
  4. Newsgroups: comp.sys.amiga
  5. Subject: Printer Device Control (source)
  6. Message-ID: <1787@cbmvax.cbmvax.cbm.UUCP>
  7. Date: 29 Apr 87 17:31:35 GMT
  8. Reply-To: andy@cbmvax.UUCP (Andy Finkel)
  9. Organization: Commodore Technology, West Chester, PA
  10. Lines: 1034
  11.  
  12. (I need a path to the amiga sources group that works.  That's
  13.  why this is here.  Promise, I won't post another source until
  14.  I figure out a working path...)
  15.  
  16. (oh, yes, I'm probably going to get comments on my gadget.c file...
  17.  yes, it can easily be done programatically, but I tend to zap
  18.  out lists of gadgets using EMACS MLISP macros when I'm in
  19.  a hurry.  Whatever you're used to, I guess)
  20.  
  21. (These sources were compiled on Greenhill's C.  You'll probably
  22.  have to fiddle a little bit to make it compile on Manx, and
  23.  to make it compile quietly on Lattice)
  24.  
  25. Remember our recent discussion on what the printer.device should
  26. be expected to do, and what an application program should be expected
  27. to do ?  (Thought you would)  This program is the result.
  28. (BTW, thanks for the advice, Carolyn)
  29.  
  30. Basically, once you fire it up it hangs around, waiting for anyone
  31. to do a DUMPRPORT.  It then fires up a requester, and lets you
  32. play with the values being passed in the IORequest block.
  33.  
  34. How to use:
  35. (from CLI)
  36. run control
  37.  
  38. this fires it up. It opens the printer.device, and installs itself.
  39.  
  40. To stop it, either send its process a ^C (using the break command)
  41. or execute it again.
  42.  
  43. (From Workbench)
  44. give it an Icon.  Double click on its icon.  To stop it, double click
  45. on its icon again.
  46.  
  47. How it works:
  48. The control program does a SetFunction on the printer.device's BeginIO
  49. and Expunge entry points.  It then checks each IORequest block sent
  50. to the printer.device.  If it finds a DUMPRPORT, it brings up a
  51. window filled with the parameters being passed to the printer.device.
  52. (Parameters are: CMap (pointer to the color map), Mode (your viewmodes),
  53. SrcX, SrcY, SrcWidth, SrcHeight, Destination Columns, Destination Rows,
  54. and the Special Flag (bits from right to left= Density 4, Density 3,
  55. Density 2, Density 1, Aspect, Centering, FracCols, FracRows, FullRows,
  56. FullCols, MilRows, and MilCols))
  57. By using the mouse and keyboard you can play with the paramters
  58. to your hearts content.
  59.  
  60. Now, some words of warning...it is very possible to pass bad flags,
  61. numbers, etc to the printer.device.  No error checking is done.
  62. (wouldn't want to limit the user :-)  )  So you can crash your
  63. machine, or send the printer device into an infinite loop, or...
  64. (If you want to make it less fun, add the error checking)
  65.  
  66. Warning #2:  This program takes memory.  Some programs on the
  67. edge may not like this.  Especially as I've disabled the Expunge
  68. of the printer.device while the control program is in operation,
  69. for safety.  Some programs are accustomed to doing an Expunge after
  70. printing (Deluxe Paint II springs to mind).  When the printer.device
  71. refuses to go away, the calling application may get upset.
  72.  
  73. Warning #3:  The control window comes up on the front screen.
  74. This might get funny on some programs (like DP II) if you fool
  75. with the gadgets too much.  If you plan to adjust dpaint
  76. pictures a lot, you might modify the program to bring the
  77. window up on the workbench screen.
  78.  
  79. Last thing...note carefully the techniques for unwinding the SetFunction,
  80. and the use of SetFunction on a device.  This can be used for
  81. many other abuses of the system.  Be careful, though...most devices
  82. run as tasks, which means that any code running as part of that task
  83. can't use DOS functions.
  84.  
  85. This posting will be in 2 parts...first the uuencoded .ld file.
  86. (please check the line lengths before uudecoding;  maybe we'll
  87.  catch the problems that way.  
  88. Lengths are: 
  89. 10903 for control.uue (after this README and trailing linefeed are removed)
  90. and 7892 for control.ld.
  91. )
  92.  
  93. -- 
  94. andy finkel        {ihnp4|seismo|allegra}!cbmvax!andy 
  95. Commodore/Amiga         /or/ pyramid!amiga!andy }
  96.  
  97. "Do not meddle with the affairs of wizards, for it makes them soggy and hard 
  98. to light."
  99.  
  100. Any expressed opinions are mine; but feel free to share.
  101. I disclaim all responsibilities, all shapes, all sizes, all colors.
  102.